<?php $this->beginContent('/layouts/main'); ?>
<?php
if (Yii::app()->getController()->id == 'site' && Yii::app()->getController()->action->id == 'index'):
    ?>
    <div id="myCarousel" class="carousel slide">
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>
        <!-- Carousel items -->
        <div class="carousel-inner">
            <div class="active item">
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/bannder.jpg" />
                <div class="carousel-caption">
                    <h4>a</h4>
                    <p>aaa</p>
                </div>
            </div>
            <div class="item">
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/bannder.jpg" />
                <div class="carousel-caption">
                    <h4>b</h4>
                    <p>bbb</p>
                </div>
            </div>
            <div class="item">
                <img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/bannder.jpg" />
                <div class="carousel-caption">
                    <h4>c</h4>
                    <p>ccc</p>
                </div>
            </div>
        </div>
        <!-- Carousel nav -->
        <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
        <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
    </div>
    <?php
endif;
?>

<div class="row mtop20">
    <div class="span4">
        <div class="sidebar">
            <h3>Products Categorys</h3>
            <ul class="nav nav-list">
                <?php
                foreach (SubsiteCategory::model()->getCategoryTree() as $c):
                    $master = $c['master'];
                    $sub = array();
                    $nav_header = '';
                    if (isset($c['sub'])) {
                        $sub = $c['sub'];
                        $nav_header = 'class="nav-header"';
                    }
                    if (!in_array($master->product_model, array('news', 'page', 'ARCHIVE', 'pictures'))):
                        ?>
                        <li <?php echo $nav_header; ?>><a href="<?php echo $this->createCategoryUrl(array('master' => $master->title_alias), $master->product_model); ?>"><?php echo $master->title; ?></a></li>
                        <?php
                        foreach ($sub as $s):
                            ?>
                        <li><a href="<?php echo $this->createCategoryUrl(array('master' => $master->title_alias, 'alias' => $s->title_alias), $s->product_model);?>"><?php echo $s->title; ?></a></li>
                        <?php endforeach; ?>
                        <?php
                    endif;
                endforeach;
                ?>
            </ul>
        </div>
        <hr/>
        <div class="sidebar">
            <h3>Live Chat</h3>
            <div class="live_chat">
                <?php echo $this->webOptions->service_livechat;?>
            </div>
            <ul class="nav nav-list">
                <li><h4>Email: <span><?php echo $this->webOptions->service_mail;?></span></h4></li>
                <li class="divider"></li>
                <li><h4>Phone: <span><?php echo $this->webOptions->service_phone;?></span></h4></li>
            </ul>
        </div>
        <hr/>
        <div class="follow">
            <ul>
                <li><a href="<?php echo $this->webOptions->sns_facebook;?>"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/facebook.jpg" /></a></li>
                <li><a href="<?php echo $this->webOptions->sns_youtube;?>"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/tube.jpg" /></a></li>
                <li><a href="<?php echo $this->webOptions->sns_twitter;?>"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/img/twitter.jpg" /></a></li>
            </ul>
        </div>

    </div>
    <div class="span8">
        <?php
        if ($this->breadcrumbs):
            ?>
            <ul class="breadcrumb">
                <li><a href="<?php echo Yii::app()->homeUrl; ?>">Home</a> <span class="divider">»</span></li>
                <?php
                foreach ($this->breadcrumbs as $key => $v) {
                    if (is_array($v)) {
                        echo CHtml::openTag('li');
                        $params = isset($v[1]) ? $v[1] : array();
                        echo CHtml::link($key, Yii::app()->createAbsoluteUrl($v[0], $params));
                        echo '<span class="divider">»</span>';
                        echo CHtml::closeTag('li');
                    } else {
                        echo CHtml::openTag('li', array('class' => 'active'));
                        echo $v;
                        echo CHtml::closeTag('li');
                    }
                }
                ?>
            </ul>
            <?php
        endif;
        ?>
        <?php echo $content; ?>
    </div>
</div>
<?php $this->endContent(); ?>